/*
 * Licensed to The Apereo Foundation under one or more contributor license
 * agreements. See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
 *
 *
 * The Apereo Foundation licenses this file to you under the Educational
 * Community License, Version 2.0 (the "License"); you may not use this file
 * except in compliance with the License. You may obtain a copy of the License
 * at:
 *
 *   http://opensource.org/licenses/ecl2.txt
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
 * License for the specific language governing permissions and limitations under
 * the License.
 *
 */


.drop-down-container {
    width: 160px;
    height: 40px;
    line-height: 40px;
    display: inline-block;
    border-radius: $main-border-radius;
    padding-left: 15px;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    @include user-select(none);

    // Pulled from Button Mixin (keep in sync with those styles)
    @include linear-gradient(#fff, #f7f7f7);
    border: $thin-border-stroke $main-border-color;
    box-shadow: inset 0px 1px 0px 0px #fff, 0px 1px 2px rgba(0,0,0,.05);
    outline: none;
    color: $medium-prim-color;
    text-shadow: 0px 1px 0px #fff;

    &:hover {
        border: $thin-border-stroke darken($main-border-color, 2%);
        @include linear-gradient(darken(#fff, 1%), darken(#f7f7f7, 1%));
        color: $medium-prim-color;
    }

    &:active {
        box-shadow: inset 0px 1px 6px 2px rgba(0,0,0,.05);
    }

    &:focus {
        outline: none;
    }

    // Menu Icon Settings
    $icon-color: $medium-prim-color;
    $icon-font-size: 15px;
    $icon-display-value: inline-block;
    $icon-pesudo-position: before;


    // FontAwesome Icon Mixin
    &:after {
        content: "\f078";
        color: inherit;
        font-family: FontAwesome;
        font-size: 12px;
        font-style: normal;
        font-weight: normal;
        line-height: 1;
        display: inline;
        margin: 0;
        padding: 0;
        @include font-smoothing(on);
    }

    &:after {
        position: absolute;
        top: 13px;
        right: 10px;
    }

    > ul {
        position: absolute;
        @include transition(all 200ms);
        background: $off-white;
        list-style: none;
        @include border-bottom-radius($main-border-radius);
        border: $thin-border-stroke $main-border-color;
        opacity: 0;
        pointer-events: none;
        z-index: $max-z + 10;
        top: 100%;
        left: -1px;
        right: -1px;

        > li {
            text-decoration: none;
            text-shadow: 0 1px 0 $white;
            color: $medium-prim-color;
            font-size: 12px;
            line-height: 20px;
            font-weight: 600;
            cursor: default;
            display: block;
            position: relative;
            @include transition(all 200ms);

            a {
                display: block;
                padding: 12px 15px;

                &:hover {
                    color: #666666;
                    background: #f2f2f2;
                }

                &.more-link {
                  text-align: center;
                  color: #378dd4;
                }
            }

            &:last-child a {
                @include border-bottom-radius($main-border-radius);
            }
        }

        > span {
            padding: 3px 15px 3px 45px;
            display: block;

            > span {
                display: block;
                font-size: 10px;
                color: $light-prim-color;
                margin-top: -20px;
            }
        }
    }

    &.small {
        width: 65px;
        height: 28px;
        line-height: 26px;
        display: inline-block;
        padding-left: 15px;
        font-weight: 600;
        font-size: 12px;
        text-shadow: 0 1px 0 $white;
        cursor: pointer;
        position: relative;
        vertical-align: middle;
        @include user-select(none);
        background-repeat: repeat-x;

        &:focus {
            outline: none;
        }

        &:after {
            position: absolute;
            top: 7px;
            right: 10px;
        }

        > ul {
            position: absolute;
            @include transition(all 200ms);
            background: $off-white;
            list-style: none;
            @include border-bottom-radius($main-border-radius);
            border: $thin-border-stroke $main-border-color;
            opacity: 0;
            pointer-events: none;
            z-index: $max-z + 10;

            > li {
                text-decoration: none;
                text-shadow: 0 1px 0 $white;
                color: $medium-prim-color;
                font-size: 12px;
                line-height: 20px;
                font-weight: 600;
                cursor: default;
                display: block;
                position: relative;
                @include transition(all 200ms);

                span {
                    padding: 3px 15px 3px 45px;
                    display: block;
                }

                span > span {
                    display: block;
                    font-size: 10px;
                    color: $light-prim-color;
                    margin-top: -20px;
                }

                a {
                    display: block;
                    padding: 4px 15px;

                    &:hover {
                        color: #666666;
                        background: #f2f2f2;
                    }

                    &.more-link {
                        text-align: center;
                        color: #378dd4;
                    }
                }

                &:last-child a {
                    @include border-bottom-radius($main-border-radius);
                }
            }
        }
    }

    // Flipped
    &.flipped {

        &.active {
            @include border-top-radius(0);
            @include border-bottom-radius($main-border-radius);
        }

        > ul {
            top: auto;
            bottom: 100%;
            @include border-top-radius($main-border-radius);
            @include border-bottom-radius(0);
        }
    }

    // Active State
    &.active {
        @include border-bottom-radius(0);

        &:after {
            @include transform(rotate(180deg));
        }

        > ul {
            opacity: 1;
            pointer-events: auto;
        }
    }
}
